<template>
  <el-dialog title="蚂蚁风控" :visible.sync="dialogVisible" width="700px">
    <el-row :gutter="20">
        <el-divider content-position="left">
          <h5>{{cert_name}}蚂蚁风控</h5>
        </el-divider>
        <el-row :gutter="20">
          <el-col :span="16" style="text-align:center;border: 0px;height: 25px;">
            <div class="grid-content bg-purple">
             风控生成时间：{{start_at }}
            </div>
          </el-col>
        </el-row>
      </el-row>
      <el-row :gutter="20">
        <el-divider content-position="left">
          <h5>蚂蚁风控信息</h5>
        </el-divider>
        <el-descriptions class="margin-top" :column="2" border>
          <el-descriptions-item label="风控级别"><span :style="level=='高危'?'color:red': level=='优质'?'color:green':''">{{ level }}</span> </el-descriptions-item>
        </el-descriptions>
      </el-row>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getAntData } from '@/api/order'
export default {
  props: {
    editItem: {
      type: Object,
      default: ()=>({})
    },
  },
  data() {
    return {
      dialogVisible: false,
      cert_name:'',
      start_at:'',
      level:''
    }
  },
  watch: {
    dialogVisible(val) {
      if (val) {
        this.$nextTick(() => {
          this.getList()
        })
      }
    }
  },
  methods: {
    getList() {
      console.log(this.editItem);
      const params = {orderId:this.editItem.id}
      console.log(params);
      getAntData(params).then(res => {
        console.log("123",res);
        this.cert_name=res.cert_name
        this.start_at=res.start_at
        this.level=res.data[0].risk_T0
      })
      console.log(this.level);
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
